package br.mikhas.container.config.convertion;

/**
 * Used to convert {@link String} objects into other type of objects
 * 
 * @author Mikhail Domanoski
 * 
 */
public interface Converter {
	/**
	 * Checks if the convert may convert a {@link String} to the providen type
	 * 
	 * @param type
	 *            The type which the string will be converted to
	 * @return <code>true</code> if the convert may convert
	 */
	public boolean accepts(Class<?> type);

	/**
	 * Converts the passed string into the convert definied type.
	 * 
	 * @param lietaralValue
	 *            The string representation of the value
	 * @param type
	 *            The required type
	 */
	public Object convert(String literalValue, Class<?> type);
}
